{# Rendered with \Sylius\Bundle\AdminBundle\Twig\Component\Taxon\TreeComponent #}

{% import '@SyliusAdmin/shared/helper/loader.html.twig' as loader %}

<div {{ attributes.defaults(stimulus_controller('@sylius/admin-bundle/taxon-tree', {autoOpen: true, treeData: this.tree|json_encode})) }}>
    <div class="card mb-5">
        {{ loader.render() }}
        <div class="card-body">
            <div class="d-none" {{ stimulus_target('@sylius/admin-bundle/taxon-tree', 'itemPrototyp') }}>
                <div class="d-flex justify-content-between infinite-tree-item" {{ sylius_test_html_attribute('tree-taxon', '__TAXON_NAME__') }}>
                    <div class="infinite-tree-node">
                        <span class="infinite-tree-toggler" data-infinite-tree-toggler></span>
                        <span class="infinite-tree-toggler infinite-tree-title" title="__TAXON_NAME__">__TAXON_NAME__</span>
                    </div>

                    {% hook 'tree' %}

                </div>
            </div>
            <div {{ stimulus_target('@sylius/admin-bundle/taxon-tree', 'tree') }} {{ sylius_test_html_attribute('tree-taxons') }}></div>
        </div>
    </div>
</div>
